<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" >

<%@ include file="../base/taglibs.jsp" %>
<%@ page session="true"%>

<html>
	<%@ include file="../base/head.jsp" %>

	<body>
		<div id="wrap">
			<%@ include file="../snipped/header.jsp"%>
			
			<div id="content">
				
				<c:if test="${edit}">
				<a href="<c:url value="/band/edit?id=${band.id}" />">Zpět na detail kapely <b><c:out value="${band.name}"/></b></a>
				<br />
				
				<form:form id="form" method="post" modelAttribute="concert"  action="concertSave">
					
					<%@ include file="../snipped/msgErr.jsp" %>
					
						<h2>Editace koncertu</h2>
						
						<fieldset>
							<table>
								<tr>		
									<td><form:label path="place">Místo:</form:label></td>
									<td><form:input path="place" maxlength="100" size="100" /></td>
								</tr>
								<tr>
									<td><form:label path="dateTime">Datum:</form:label></td>
									<td><form:input path="dateTime" /><small>vzor: RRRR-MM-DD</small></td>
								</tr>
								<tr>
									<td><form:label path="description">Popis:</form:label></td>
									<td><form:textarea path="description" cols="85" rows="3" /><br /><small>max. 100 znaků</small></td>
								</tr>
							</table>
						</fieldset>
						
						<p><button type="submit">Uložit</button><form:input path="id" cssStyle="visibility:hidden;" /></p>
						
					</form:form>
				
				</c:if>
				
				<c:if test="${not edit}">
				
				<h2>Detail koncertu</h2>
				
				<a href="<c:url value="/band/browse?id=${band.id}" />">Zpět na detail kapely <b><c:out value="${band.name}"/></b></a>
				<br />
				
				<table>
					<tr>
						<th>Místo:</th>
						<td><c:out value="${concert.place}"/></td>
					</tr>
					<tr>
						<th>Datum:</th>
						<td><c:out value="${concert.dateTime}"/></td>
					</tr>
					<tr>
						<th>Popis:</th>
						<td><c:out value="${concert.description}"/></td>
					</tr>
				</table>
				
				</c:if>
				
				<h2>Kapely na koncertu</h2>
				
				<table width="100%">
					<tr>
						<th></th>
						<th>Název</th>
						<th>Email</th>
						<th>Popis</th>
					</tr>
					
					<c:forEach items="${concert.bands}" var="row" varStatus="stat">
					<tr class="${stat.index % 2 == 0 ? 'odd' : 'even'}" id="row${stat.index}">
						<td>${stat.index + 1}.</td>
						<td><c:out value="${row.name}"/></td>
						<td><c:out value="${row.email}"/></td>
						<td><c:out value="${row.description}"/></td>
					</tr>
					</c:forEach>
						
				</table>
				
			</div>
			
			<br />
			<%@ include file="../snipped/footer.jsp"%>
		</div>
	</body>
	
</html>